package com.yycx.module.bus.provider.handler.huikuan;

import com.yycx.common.base.entity.EntityMap;
import com.yycx.common.mybatis.interceptor.DeleteInterceptor;
import com.yycx.common.mybatis.query.CriteriaDelete;
import com.yycx.module.bus.provider.service.BusOrderDetailsService;
import com.yycx.module.bus.provider.service.BusPaymentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.io.Serializable;

/**
 * 回款删除扩展
 *
 * @author zyf
 */
@Component("huikuanPaymentDeleteHandler")
public class HuikuanPaymentDeleteHandler implements DeleteInterceptor {


    @Autowired
    private BusPaymentService paymentService;

    @Autowired
    private BusOrderDetailsService orderDetailsService;


    @Override
    public void prepare(CriteriaDelete cd, EntityMap entityMap) {


    }

    @Override
    public void complete(CriteriaDelete cd, EntityMap params) {
        Serializable paymentId = cd.getIdValue();
        orderDetailsService.clearHuiKuanInfo(paymentId);
    }
}
